import requests;

#从谷歌浏览器里拷过来的
header={'User-Agent':'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'};

d={'cat':1001,'q':'java'};
r=requests.get('https://www.douban.com',headers=header);
print(r.url);

